package com.appcloner.di

import com.appcloner.data.repository.AppRepository
import com.appcloner.data.repository.CardRepository
import com.appcloner.data.repository.ClonerRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {
    
    @Provides
    @Singleton
    fun provideCardRepository(
        apiService: com.appcloner.network.ApiService,
        appPreferences: com.appcloner.data.local.datastore.AppPreferences
    ): CardRepository {
        return CardRepository(apiService, appPreferences)
    }
    
    @Provides
    @Singleton
    fun provideAppRepository(
        @dagger.hilt.android.qualifiers.ApplicationContext context: android.content.Context
    ): AppRepository {
        return AppRepository(context)
    }
    
    @Provides
    @Singleton
    fun provideClonerRepository(
        @dagger.hilt.android.qualifiers.ApplicationContext context: android.content.Context
    ): ClonerRepository {
        return ClonerRepository(context)
    }
}
